package Day17;

public class Text2 {
    public static void main(String[] args) {
        //冒泡排序
        int[] arr = {5,4,3,2,1,0};

        for(int i = 0; i < arr.length -1;i++){
            int tmep = 0;
            for(int j = 0; j < arr.length-1-i; j++){
                if(arr[j] > arr[j + 1]){
                    tmep = arr[j + 1];
                    arr[j + 1] = arr[j];
                    arr[j] = tmep;
                }
            }
            System.out.println("\n=====第"+(i + 1)+"次排序======");
            for (int i1 = 0; i1 < arr.length; i1++) {
                System.out.print(arr[i1] + " ");
            }
        }
    }
}
